<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>编辑用户</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
	<script src="/static/admin/js/address3.js?v=1"></script>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header">
					{if !$ainfo['id']}<i class="fa fa-plus"></i> 添加用户{else}<i class="fa fa-pencil"></i> 编辑用户{/if}
					{if input('param.isopen')==1}<i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i>{/if}
				</div>
				<div class="layui-card-body" pad15>
					<div class="layui-form" lay-filter="">
						<input type="hidden" name="ainfo[id]" value="{$ainfo['id']}">
						<input type="hidden" name="uinfo[id]" value="{$uinfo['id']}">
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">登录账号：</label>
							<div class="layui-input-inline">
								<input type="text" name="uinfo[un]" value="{$uinfo['un']}" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">登录密码：</label>
							<div class="layui-input-inline">
								<input type="text" class="layui-input" autocomplete="off" name="uinfo[pwd]" value="" {if $uinfo['id']} placeholder="留空表示不修改密码"{else} lay-verify="required" lay-verType="tips"{/if}>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">联系人：</label>
							<div class="layui-input-inline">
								<input type="text" name="ainfo[linkman]" value="{$ainfo['linkman']}" autocomplete="off" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">联系电话：</label>
							<div class="layui-input-inline">
								<input type="text" name="ainfo[tel]" value="{$ainfo['tel']}" autocomplete="off" class="layui-input">
							</div>
						</div>
						<!-- <div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">地区：</label>
							<div class="layui-input-inline">
								<select name="ainfo[province]" id="province" lay-filter="province"></select>
							</div>
							<div class="layui-input-inline">
								<select name="ainfo[city]" id="city" lay-filter="city"></select>
							</div>
							<div class="layui-input-inline">
								<select name="ainfo[area]" id="area" ></select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">地址：</label>
							<div class="layui-input-inline">
								<input type="text" name="ainfo[address]" value="{$ainfo['address']}" class="layui-input">
							</div>
						</div> -->
						<div class="layui-form-item" id="endtimediv">
							<label class="layui-form-label" style="width:150px">到期时间：</label>
							<div class="layui-input-inline">
								<input type="text" id="endtime" name="ainfo[endtime]" value="{:date('Y-m-d H:i:s',$ainfo['endtime'])}" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">前端独立域名：</label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">https://</div>
							<div class="layui-input-inline">
								<input type="text" name="ainfo[domain]" value="{$ainfo['domain']}" autocomplete="off" class="layui-input">
							</div>
							<div class="layui-form-mid layui-word-aux">不需要设置手机端独立访问域名无须填写</div>
							<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:180px">设置后手机端可以用该域名进行访问，注意：后台还是使用统一域名进行访问<br>设置方法：在宝塔添加站点域名填写独立域名，根目录选择系统的原安装目录，配置ssl证书</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">版权信息：</label>
							<div class="layui-input-inline" style="width:300px;">
								<textarea type="text" name="ainfo[copyright]" class="layui-textarea" style="min-height:60px">{$ainfo['copyright']}</textarea>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">类型：</label>
							<div class="layui-input-inline" style="width:500px">
								{php}$platform = getplatformname();{/php}
								{foreach $platform as $k=>$v}
								<input type="checkbox" name="ainfo[platform][]" value="{$k}" title="{$v}" lay-skin="primary" {if in_array($k,explode(',',$ainfo['platform']))}checked{/if}>
								{/foreach}
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">微支付抽成：</label>
							<div class="layui-input-inline" style="width:500px">
								<input type="radio" name="ainfo[chouchengset]" value="0" {if !$ainfo['chouchengset'] || $ainfo['chouchengset']==0}checked{/if} title="按默认抽成" lay-filter="achouchengset">
								<input type="radio" name="ainfo[chouchengset]" value="1" {if $ainfo['chouchengset']==1}checked{/if} title="按百分百抽成" lay-filter="achouchengset">
								<input type="radio" name="ainfo[chouchengset]" value="2" {if $ainfo['chouchengset']==2}checked{/if} title="固定抽成" lay-filter="achouchengset">
								<input type="radio" name="ainfo[chouchengset]" value="3" {if $ainfo['chouchengset']==3}checked{/if} title="不抽成" lay-filter="achouchengset">
							</div>
							<div class="layui-form-mid layui-word-aux">设置抽成需开通服务商分账功能</div>
						</div>
						<div class="layui-form-item" id="achouchengset1" {if $ainfo['chouchengset']!=1}style="display:none"{/if}>
							<label class="layui-form-label" style="width:150px"></label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 抽成比例(%) </div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="ainfo[chouchengrate]" class="layui-input" value="{$ainfo.chouchengrate}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 最低抽成金额(元) </div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="ainfo[chouchengmin]" class="layui-input" value="{$ainfo.chouchengmin}">
							</div>
						</div>
						<div class="layui-form-item" id="achouchengset2" {if $ainfo['chouchengset']!=2}style="display:none"{/if}>
							<label class="layui-form-label" style="width:150px"></label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 抽成金额(元) </div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="ainfo[chouchengmoney]" class="layui-input" value="{$ainfo.chouchengmoney}">
							</div>
						</div>
						{if getcustom('choucheng_receiver')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">分账接收方：</label>
							<div class="layui-input-inline" style="width:600px">
								<input type="radio" name="ainfo[choucheng_receivertype]" value="0" title="服务商" {if !$ainfo || $ainfo['choucheng_receivertype']==0}checked{/if} lay-filter="choucheng_receivertype">
								<input type="radio" name="ainfo[choucheng_receivertype]" value="1" title="商户号" {if $ainfo['choucheng_receivertype']==1}checked{/if} lay-filter="choucheng_receivertype">
								<input type="radio" name="ainfo[choucheng_receivertype]" value="2" title="个人openid" {if $ainfo['choucheng_receivertype']==2}checked{/if} lay-filter="choucheng_receivertype">
							</div>
						</div>
						
						<div class="layui-form-item" id="choucheng_receivertype1" {if $ainfo['choucheng_receivertype']!=1}style="display:none"{/if}>
							<label class="layui-form-label" style="width:150px"></label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 商户号(必填) </div>
							<div class="layui-input-inline" style="width: 150px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="ainfo[choucheng_receivertype1_account]" class="layui-input" value="{$ainfo.choucheng_receivertype1_account}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 商户全称(必填)</div>
							<div class="layui-input-inline" style="width: 200px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="ainfo[choucheng_receivertype1_name]" class="layui-input" value="{$ainfo.choucheng_receivertype1_name}">
							</div>
						</div>
						<div class="layui-form-item" id="choucheng_receivertype2" {if $ainfo['choucheng_receivertype']!=2}style="display:none"{/if}>
							<label class="layui-form-label" style="width:150px"></label>
							<div class="layui-input-inline" style="width:300px">
								<input type="radio" name="ainfo[choucheng_receivertype2_openidtype]" value="0" title="服务商openid" {if $ainfo['choucheng_receivertype2_openidtype']==0}checked{/if} lay-filter="choucheng_receivertype2_openidtype">
								<input type="radio" name="ainfo[choucheng_receivertype2_openidtype]" value="1" title="子商户openid" {if $ainfo['choucheng_receivertype2_openidtype']==1}checked{/if} lay-filter="choucheng_receivertype2_openidtype">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 公众号openid </div>
							<div class="layui-input-inline" style="width:150px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="ainfo[choucheng_receivertype2_account]" class="layui-input" value="{$ainfo.choucheng_receivertype2_account}">
							</div>
							<div id="choucheng_receivertype2_accountwx" {if $ainfo['choucheng_receivertype2_openidtype']!=1}style="display:none"{/if}>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 小程序openid </div>
								<div class="layui-input-inline" style="width:150px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="ainfo[choucheng_receivertype2_accountwx]" class="layui-input" value="{$ainfo.choucheng_receivertype2_accountwx}">
								</div>
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 姓名(选填) </div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="ainfo[choucheng_receivertype2_name]" class="layui-input" value="{$ainfo.choucheng_receivertype2_name}">
							</div>
							<div class="layui-form-mid layui-word-aux" style="clear:both;margin-left:180px">服务商openid由服务商的APPID转换得到，子商户openid由子商户APPID转换得到</div>
						</div>
						{/if}

						{if getcustom('agent_card')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">代理卡片：</label>
							<div class="layui-input-inline">
								<input type="radio" name="ainfo[agent_card]" value="1" title="开启" {if $ainfo['agent_card']==1}checked{/if}>
								<input type="radio" name="ainfo[agent_card]" value="0" title="关闭" {if $ainfo['agent_card']==0}checked{/if}>
							</div>
						</div>
						{/if}
						{if getcustom('image_search')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">图搜：</label>
							<div class="layui-input-inline">
								<input type="radio" name="ainfo[image_search]" value="1" title="开启" {if $ainfo['image_search']==1}checked{/if}>
								<input type="radio" name="ainfo[image_search]" value="0" title="关闭" {if $ainfo['image_search']==0}checked{/if}>
							</div>
						</div>
						{/if}
					  {if getcustom('with_system_param')}
					  <div class="layui-form-item">
						  <label class="layui-form-label" style="width:150px">外链参数：</label>
						  <div class="layui-input-inline">
							  <input type="radio" name="ainfo[with_system_param]" value="1" title="开启" {if $ainfo['with_system_param']==1}checked{/if}>
							  <input type="radio" name="ainfo[with_system_param]" value="0" title="关闭" {if $ainfo['with_system_param']==0}checked{/if}>
						  </div>
						  <div class="layui-form-mid layui-word-aux">开启后，外部链接将携带系统的aid和mid</div>
					  </div>
					  {/if}
					{if getcustom('school_product')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">收集学生资料：</label>
							<div class="layui-input-inline">
							  <input type="radio" name="ainfo[need_school]" value="1" title="开启" {if $ainfo['need_school']==1}checked{/if}>
							  <input type="radio" name="ainfo[need_school]" value="0" title="关闭" {if $ainfo['need_school']==0}checked{/if}>
							</div>
							<div class="layui-form-mid layui-word-aux">开启后，需要维护学校班级信息</div>
						</div>
					{/if}
						{if getcustom('order_show_onlychildren')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">管理员仅可查看下级订单和会员：</label>
							<div class="layui-input-inline">
								<input type="radio" name="ainfo[order_show_onlychildren]" value="1" title="开启" {if $ainfo['order_show_onlychildren']==1}checked{/if}>
								<input type="radio" name="ainfo[order_show_onlychildren]" value="0" title="关闭" {if $ainfo['order_show_onlychildren']==0}checked{/if}>
							</div>
						</div>
						{/if}
						{if getcustom('other_money')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">多账户：</label>
							<div class="layui-input-inline">
								<input type="radio" name="ainfo[othermoney_status]" value="1" title="开启" {if $ainfo['othermoney_status']==1}checked{/if}>
								<input type="radio" name="ainfo[othermoney_status]" value="0" title="关闭" {if !$ainfo['othermoney_status'] || $ainfo['othermoney_status']==0}checked{/if}>
							</div>
						</div>
						{/if}
  						{if getcustom('commission_frozen')}
						  <div class="layui-form-item">
							  <label class="layui-form-label" style="width:150px">{:t('扶持金')}：</label>
							  <div class="layui-input-inline">
								  <input type="radio" name="ainfo[commission_frozen]" value="1" title="开启" {if $ainfo['commission_frozen']==1}checked{/if}>
								  <input type="radio" name="ainfo[commission_frozen]" value="0" title="关闭" {if !$ainfo['commission_frozen'] || $ainfo['commission_frozen']==0}checked{/if}>
							  </div>
						  </div>
  						{/if}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">状态：</label>
							<div class="layui-input-inline">
								<input type="radio" name="ainfo[status]" value="1" title="开启" {if $ainfo['status']==1}checked{/if}>
								<input type="radio" name="ainfo[status]" value="0" title="关闭" {if $ainfo['status']==0}checked{/if}>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">模块权限：</label>
							<div class="layui-input-inline">
								<input type="radio" name="uinfo[auth_type]" value="1" title="所有" {if !$uinfo['aid'] || $uinfo['auth_type']==1}checked{/if} lay-filter="auth_type">
								<input type="radio" name="uinfo[auth_type]" value="0" title="选择" {if $uinfo['aid'] && $uinfo['auth_type']==0}checked{/if} lay-filter="auth_type">
							</div>
						</div>

						<div class="layui-form-item" id="authdataset" style="{if !$uinfo['aid'] || $uinfo['auth_type']==1}display:none{/if}">
							<label class="layui-form-label" style="width:150px">权限设置：</label>
							<div class="layui-input-block" style="margin-left:180px;">
								<div style="margin-top:10px;color:#303030; font-size:14px; font-weight:600; ">
									<input type="checkbox" title="全部选择" lay-skin="primary" lay-filter="checkall_all"/>
								</div>
								{php}$i=0;{/php}
								{foreach $menudata as $k=>$v}
								{php}$i++;{/php}
								<div>
									<div style="clear:left;margin-top:10px;color:#303030; font-size:14px; font-weight:600; ">
										 <input type="checkbox" title="{$v['name']}" lay-skin="primary" lay-filter="checkall"/>
									</div>
									<div style="margin-left:20px">
									{foreach $v['child'] as $k1=>$v1}
									{php}
									if(!$v1['authdata'] && $v1['child']){
										$path = array();
										echo '<div style="width: 100px;float:left;margin-top:8px;clear:left">'.$v1['name'].'</div>';
										foreach($v1['child'] as $v2){
											echo '<div style="min-width: 120px;float: left;">';
											echo '	<input type="checkbox" value="'.$v2['path'].','.str_replace('/*','^_^',$v2['authdata']).'" name="auth_data[]" '.(in_array($v2['path'].','.$v2['authdata'],$auth_data)?'checked':'').' title="'.$v2['name'].'" lay-skin="primary"/>';
											echo '</div>';
										}
										echo '<div style="clear:both;float: left;"></div>';
									}
									{/php}
									{if !$v1['child'] || $v1['authdata']}
									<div style="min-width: 120px;float: left;">
										<input type="checkbox" value="{$v1.path},{:str_replace('/*','^_^',$v1['authdata'])}" name="auth_data[]" {if in_array($v1['path'].','.$v1['authdata'],$auth_data)}checked{/if} title="{$v1['name']}" lay-skin="primary"/>
									</div>
									{/if}
									{/foreach}
									</div>
									<div style="clear:both;float: left;margin-bottom:10px"></div>
								</div>
								{/foreach}
							</div>
						</div>
  <!-- 需同步修改 public\user_auth.html -->
  <div class="layui-form-item">
	  <label class="layui-form-label" style="width:150px">手机端权限：</label>
	  <div class="layui-input-block" style="margin-left:180px;">
		  <div style="margin-top:10px;color:#303030; font-size:14px; font-weight:600; ">
			  <input type="checkbox" title="全部选择" lay-skin="primary" lay-filter="checkall_all"/>
		  </div>
		  <div>
			  <div style="margin-top:10px;color:#303030; font-size:14px; font-weight:600; ">
				  <input type="checkbox" title="查看权限" lay-skin="primary" lay-filter="checkall"/>
			  </div>
			  <div style="margin-left:20px">
				  <div style="min-width: 120px;float: left;">
					  <input type="checkbox" value="member" name="wxauth_data[]" {if in_array('member',$wxauth_data)}checked{/if} title="{:t('会员')}" lay-skin="primary"/>
				  </div>
				  <div style="min-width: 120px;float: left;">
					  <input type="checkbox" value="product" name="wxauth_data[]" {if in_array('product',$wxauth_data)}checked{/if} title="商品" lay-skin="primary"/>
				  </div>
				  <div style="min-width: 120px;float: left;">
					  <input type="checkbox" value="order" name="wxauth_data[]" {if in_array('order',$wxauth_data)}checked{/if} title="订单" lay-skin="primary"/>
				  </div>
				  <div style="min-width: 120px;float: left;">
					  <input type="checkbox" value="finance" name="wxauth_data[]" {if in_array('finance',$wxauth_data)}checked{/if} title="财务" lay-skin="primary"/>
				  </div>
				  <div style="min-width: 120px;float: left;">
					  <input type="checkbox" value="zixun" name="wxauth_data[]" {if in_array('zixun',$wxauth_data)}checked{/if} title="咨询" lay-skin="primary"/>
				  </div>
				  <div style="clear:both;float: left;margin-bottom:10px"></div>
			  </div>
		  </div>
		  <div>
			  <div style="clear:left;margin-top:10px;color:#303030; font-size:14px; font-weight:600; ">
				  <input type="checkbox" title="接收通知权限" lay-skin="primary" lay-filter="checkall"/>
			  </div>
			  <div style="margin-left:20px">
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="订单提交通知" name="notice_auth_data[]" {if in_array('tmpl_orderconfirm',$notice_auth_data)}checked{/if} value="tmpl_orderconfirm" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="订单支付通知" name="notice_auth_data[]" {if in_array('tmpl_orderpay',$notice_auth_data)}checked{/if} value="tmpl_orderpay" lay-skin="primary"/>
				  </div>

				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="订单收货通知" name="notice_auth_data[]" {if in_array('tmpl_ordershouhuo',$notice_auth_data)}checked{/if} value="tmpl_ordershouhuo" lay-skin="primary"/>
				  </div>

				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="退款申请通知" name="notice_auth_data[]" {if in_array('tmpl_ordertui',$notice_auth_data)}checked{/if} value="tmpl_ordertui" lay-skin="primary"/>
				  </div>

				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="提现申请通知" name="notice_auth_data[]" {if in_array('tmpl_withdraw',$notice_auth_data)}checked{/if} value="tmpl_withdraw" lay-skin="primary"/>
				  </div>

				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="升级申请通知" name="notice_auth_data[]" {if in_array('tmpl_uplv',$notice_auth_data)}checked{/if} value="tmpl_uplv" lay-skin="primary"/>
				  </div>

				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="表单提交通知" name="notice_auth_data[]" {if in_array('tmpl_formsub',$notice_auth_data)}checked{/if} value="tmpl_formsub" lay-skin="primary"/>
				  </div>

				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="用户咨询通知" name="notice_auth_data[]" {if in_array('tmpl_kehuzixun',$notice_auth_data)}checked{/if} value="tmpl_kehuzixun" lay-skin="primary"/>
				  </div>

				  <div style="clear:both;float: left;margin-bottom:10px"></div>
			  </div>
		  </div>

		  <div>
			  <div style="clear:left;margin-top:10px;color:#303030; font-size:14px; font-weight:600; ">
				  <input type="checkbox" title="核销权限" lay-skin="primary" lay-filter="checkall"/>
			  </div>
			  <div style="margin-left:20px">
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="商城订单" name="hexiao_auth_data[]" {if in_array('shop',$hexiao_auth_data)}checked{/if} value="shop" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="拼团订单" name="hexiao_auth_data[]" {if in_array('collage',$hexiao_auth_data)}checked{/if} value="collage" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="幸运拼团订单" name="hexiao_auth_data[]" {if in_array('lucky_collage',$hexiao_auth_data)}checked{/if} value="lucky_collage" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="周期购" name="hexiao_auth_data[]" {if in_array('cycle',$hexiao_auth_data)}checked{/if} value="cycle" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="砍价订单" name="hexiao_auth_data[]" {if in_array('kanjia',$hexiao_auth_data)}checked{/if} value="kanjia" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="秒杀订单" name="hexiao_auth_data[]" {if in_array('seckill',$hexiao_auth_data)}checked{/if} value="seckill" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="预约订单" name="hexiao_auth_data[]" {if in_array('yuyue',$hexiao_auth_data)}checked{/if} value="yuyue" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="{:t('积分')}兑换" name="hexiao_auth_data[]" {if in_array('scoreshop',$hexiao_auth_data)}checked{/if} value="scoreshop" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="{:t('优惠券')}" name="hexiao_auth_data[]" {if in_array('coupon',$hexiao_auth_data)}checked{/if} value="coupon" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="抽奖活动" name="hexiao_auth_data[]" {if in_array('choujiang',$hexiao_auth_data)}checked{/if} value="choujiang" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="点餐订单" name="hexiao_auth_data[]" {if in_array('restaurant_shop',$hexiao_auth_data)}checked{/if} value="restaurant_shop" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="外卖订单" name="hexiao_auth_data[]" {if in_array('restaurant_takeaway',$hexiao_auth_data)}checked{/if} value="restaurant_takeaway" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="团购订单" name="hexiao_auth_data[]" {if in_array('tuangou',$hexiao_auth_data)}checked{/if} value="tuangou" lay-skin="primary"/>
				  </div>
				  {if getcustom('freight_selecthxbids')}
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="计次商品" name="hexiao_auth_data[]" {if in_array('shopproduct',$hexiao_auth_data)}checked{/if} value="shopproduct" lay-skin="primary"/>
				  </div>
				  {/if}

				  <div style="clear:both;float: left;margin-bottom:10px"></div>
			  </div>
		  </div>
		  <div>
			  <div style="clear:left;margin-top:10px;color:#303030; font-size:14px; font-weight:600; ">
				  <input type="checkbox" title="餐饮权限" lay-skin="primary" lay-filter="checkall"/>
			  </div>
			  <div style="margin-left:20px">
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="菜品管理" name="wxauth_data[]" {if in_array('restaurant_product',$wxauth_data)}checked{/if} value="restaurant_product" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="餐桌设置" name="wxauth_data[]" {if in_array('restaurant_table',$wxauth_data)}checked{/if} value="restaurant_table" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="餐桌管理" name="wxauth_data[]" {if in_array('restaurant_tableWaiter',$wxauth_data)}checked{/if} value="restaurant_tableWaiter" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="点餐订单" name="wxauth_data[]" {if in_array('restaurant_shop',$wxauth_data)}checked{/if} value="restaurant_shop" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="外卖订单" name="wxauth_data[]" {if in_array('restaurant_takeaway',$wxauth_data)}checked{/if} value="restaurant_takeaway" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="预定" name="wxauth_data[]" {if in_array('restaurant_booking',$wxauth_data)}checked{/if} value="restaurant_booking" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="寄存" name="wxauth_data[]" {if in_array('restaurant_deposit',$wxauth_data)}checked{/if} value="restaurant_deposit" lay-skin="primary"/>
				  </div>
				  <div style="width: 120px;float: left;">
					  <input type="checkbox" title="排队" name="wxauth_data[]" {if in_array('restaurant_queue',$wxauth_data)}checked{/if} value="restaurant_queue" lay-skin="primary"/>
				  </div>
				  <div style="clear:both;float: left;margin-bottom:10px"></div>
			  </div>
		  </div>

	  </div>
  </div>

						<div class="layui-form-item">
							<label class="layui-form-label" style="width:150px">附件存储类型：</label>
							<div class="layui-input-inline" style="width:300px">
								<select name="rinfo[type]" lay-filter="changetype">
									<option value="0" {if $rinfo['type']==0}selected{/if}>跟随平台附件设置</option>
									<option value="1" {if $rinfo['type']==1}selected{/if}>本地存储</option>
									<option value="2" {if $rinfo['type']==2}selected{/if}>阿里云</option>
									<option value="3" {if $rinfo['type']==3}selected{/if}>七牛云</option>
									<option value="4" {if $rinfo['type']==4}selected{/if}>腾讯云</option>
								</select>
							</div>
						</div>
						<div id="aliossset" {if $rinfo['type']!=2}style="display:none"{/if}>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Access Key ID：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[alioss][key]" value="{$rinfo['alioss']['key']}" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Access Key Secret：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[alioss][secret]" value="{$rinfo['alioss']['secret']}" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Bucket名称：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[alioss][bucket]" value="{$rinfo['alioss']['bucket']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">空间名称</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">EndPoint（地域节点）</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[alioss][ossurl]" value="{$rinfo['alioss']['ossurl']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">如：oss-cn-qingdao.aliyuncs.com</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Bucket域名：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[alioss][url]" value="{$rinfo['alioss']['url']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">开头须加https://</div>
							</div>
						</div>
						<div id="qiniuset" {if $rinfo['type']!=3}style="display:none"{/if}>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Accesskey：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[qiniu][accesskey]" value="{$rinfo['qiniu']['accesskey']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">在密钥管理中查找</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Secretkey：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[qiniu][secretkey]" value="{$rinfo['qiniu']['secretkey']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">在密钥管理中查找</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Bucket：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[qiniu][bucket]" value="{$rinfo['qiniu']['bucket']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">空间名称</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Url：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[qiniu][url]" value="{$rinfo['qiniu']['url']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">开头须加https://</div>
							</div>
						</div>
						<div id="cosset" {if $rinfo['type']!=4}style="display:none"{/if}>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">APPID：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[cos][appid]" value="{$rinfo['cos']['appid']}" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">SecretID：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[cos][secretid]" value="{$rinfo['cos']['secretid']}" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">SecretKEY：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[cos][secretkey]" value="{$rinfo['cos']['secretkey']}" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Bucket：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[cos][bucket]" value="{$rinfo['cos']['bucket']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">存储桶名称</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">bucket所属地域：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[cos][local]" value="{$rinfo['cos']['local']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">地域代码，如：ap-beijing</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:150px">Url：</label>
								<div class="layui-input-inline" style="width:300px">
									<input type="text" name="rinfo[cos][url]" value="{$rinfo['cos']['url']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">开头须加https://</div>
							</div>
						</div>
					  <div class="layui-form-item">
						  <label class="layui-form-label" style="width:150px">备注：</label>
						  <div class="layui-input-inline" style="width:300px;">
							  <textarea type="text" name="ainfo[remark]" class="layui-textarea" style="min-height:60px">{$ainfo['remark']}</textarea>
						  </div>
					  </div>

						<div class="layui-form-item">
							<div class="layui-input-block" style="margin-left:180px;">
								<button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	{include file="public/js"/}
	<script>
	//address3('province','city','area',"{$ainfo['province']}","{$ainfo['city']}","{$ainfo['area']}");
	layui.form.on('checkbox(checkall_all)',function(data){
		if(data.elem.checked){
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',true);
		}else{
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',false);
		}
		layui.form.render('checkbox'); 
	})
	layui.laydate.render({ 
		elem: '#endtime',
		type: 'datetime'
	});
	layui.form.on('radio(auth_type)', function(data){
		if(data.value == '0'){
			$('#authdataset').show();
		}else{
			$('#authdataset').hide();
		}
	})
	layui.form.on('radio(achouchengset)', function(data){
		if(data.value == '1'){
			$('#achouchengset1').show();
			$('#achouchengset2').hide();
		}else if(data.value == '2'){
			$('#achouchengset1').hide();
			$('#achouchengset2').show();
		}else{
			$('#achouchengset1').hide();
			$('#achouchengset2').hide();
		}
	})
	layui.form.on('checkbox(checkall)',function(data){
		if(data.elem.checked){
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',true);
		}else{
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',false);
		}
		layui.form.render('checkbox'); 
	})
	layui.form.on('select(changetype)',function(data){
		$('#aliossset').hide()
		$('#qiniuset').hide()
		$('#cosset').hide()
		if(data.value==2){
			$('#aliossset').show()
		}
		if(data.value==3){
			$('#qiniuset').show()
		}
		if(data.value==4){
			$('#cosset').show()
		}
	})
	
	layui.form.on('radio(choucheng_receivertype)', function(data){
		$('#choucheng_receivertype1').hide();
		$('#choucheng_receivertype2').hide();
		if(data.value == '1'){
			$('#choucheng_receivertype1').show();
		}
		if(data.value == '2'){
			$('#choucheng_receivertype2').show();
		}
	});
	layui.form.on('radio(choucheng_receivertype2_openidtype)', function(data){
		$('#choucheng_receivertype2_accountwx').hide();
		if(data.value == '1'){
			$('#choucheng_receivertype2_accountwx').show();
		}
	});

	

	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		var index = layer.load();
		$.post("{:url('save')}",field,function(data){
			layer.close(index);
			{if input('param.isopen')==1}
				dialog(data.msg,data.status);
				if(data.status == 1){
					setTimeout(function(){
						parent.layer.closeAll();
						parent.tableIns.reload()
					},1000)
				}
			{else}
				dialog(data.msg,data.status,data.url);
			{/if}
		})
	})
  </script>
</body>
</html>